package com.xbongbong.saas.model;


import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.saas.domain.entity.KnowledgeTagEntity;

import java.util.List;
import java.util.Map;
import java.util.Set;


/**
 * @Author mingliang
 * @Description
 * @Date 2022/7/4 9:19
 **/
public interface KnowledgeTagModel extends IModel<KnowledgeTagEntity> {

    @Override
    Integer insert(KnowledgeTagEntity entity);

    @Override
    Integer update(KnowledgeTagEntity entity) throws XbbException;

    @Override
    List<KnowledgeTagEntity> findEntitys(Map<String, Object> param);

    @Override
    Integer getEntitysCount(Map<String, Object> param);

    @Override
    List<KnowledgeTagEntity> findEntitysWithoutSub(Map<String, Object> param);

    void insertBatch(List<KnowledgeTagEntity> list);

    KnowledgeTagEntity getByKey(Long key, String corpid);

    /**
     * 获取某一业务的所有物料标签
     *
     * @param corpid
     * @return tagId, name的map
     */
    Map<Long, KnowledgeTagEntity> getTagDataMap(Set<Long> tagList, String corpid);

    /**
     * 获取某一业务的所有物料标签分组
     *
     * @param corpid
     * @return tagId, name的map
     */
    Map<Long, String> getParentTagMap(String corpid);

    List<KnowledgeTagEntity> getByTagIdList(List<Long> tagIdList, String corpid);

    /**
     * 移动到回收站
     *
     * @param idList -
     * @param corpid -
     */
    void move2RecycleBin(List<Long> idList, String corpid);

    void deleteById(Long id, String corpid);

    void deleteByIdList(List<Long> idList, String corpid);

    void sort(Map<String, Object> param, Map<Long, Long> sortMap);

    void editSameCount(List<String> nameList, String corpid);
}
